import request from '@/utils/request'

// 查询考试设备列表
export function listDev(query) {
  return request({
    url: '/business/examDevs',
    method: 'get',
    params: query
  })
}

// 删除考试设备
export function delDev(id) {
  return request({
    url: '/business/examDevs/' + id,
    method: 'delete'
  })
}

// 导出考试设备
export function exportDev(query) {
  return request({
    url: '/business/examDevs/export',
    method: 'post',
    params: query
  })
}

// 导出考试设备模板
export function exportModel(query) {
  return request({
    url: '/business/examDevs/exportModel',
    method: 'post',
    params: query
  })
}

// 分组列表
export function groupDevs() {
  return request({
    url: '/business/examDevs/groups',
    method: 'get'
  })
}

// 考试设备导入
export function importDevs(data) {
  return request({
    url: '/business/examDevs/import',
    method: 'post',
    params: data
  })
}

// 考试设备按组启用/禁用
export function switchUseStatusForGroup(data) {
  return request({
    url: '/business/examDevs/switchUseStatusForGroup',
    method: 'put',
    params: data
  })
}

// 考试设备启用/禁用
export function switchUseStatus(id) {
  return request({
    url: '/business/examDevs/'+id+'/switchUseStatus',
    method: 'put'
  })
}

// 考试设备更新-名称与性别
export function updatePart(id,data) {
  return request({
    url: '/business/examDevs/'+id+'/updatePart',
    method: 'put',
    data: data
  })
}

// 考试设备更新
export function updateDevs(id,data) {
  return request({
    url: '/business/examDevs/'+id,
    method: 'put',
    data: data
  })
}

// 查询考试设备详细
export function getDev(id) {
  return request({
    url: '/business/examDevs/' + id,
    method: 'get'
  })
}
